<%@ page language="java" import="com.bjsxt.shopping.user.*,com.bjsxt.shopping.product.*,com.bjsxt.shopping.util.Util"
	pageEncoding="utf-8"%>
<%@ page import="java.util.*"%>

<%
	User u = (User)session.getAttribute("user");
	
	//判断会话过期处理
	if(Util.ifSessionExpire(u)){
		response.sendRedirect("UserLogin.jsp");
		return;
	}
	
	String consumerid = u.getLoginname();

	final int PAGE_SIZE = 8;
	int pageNo = 1;
	String strPageNo = request.getParameter("pageNo");
	if (strPageNo != null && !strPageNo.trim().equals("")) {
		try {
	pageNo = Integer.parseInt(strPageNo);
		} catch (NumberFormatException e) {
	pageNo = 1;
		}
	}
	if (pageNo <= 0)
		pageNo = 1;
	// int categoryId = Integer.parseInt(request.getParameter("categoryId"));
	
	int categoryId =1;
	
	List<Product> products = new ArrayList<Product>();
	int totalRecords = ProductMgr.getInstance().findWebpage(products, pageNo,
	PAGE_SIZE, categoryId);

	int totalPages = (totalRecords + PAGE_SIZE - 1) / PAGE_SIZE;

	if (pageNo > totalPages)
		pageNo = totalPages;
%>



<html>
	<head>

		<meta http-equiv="Content-Language" content="zh-cn">
		<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
		<title>--待翻译订单列表</title>

		<link href="images/new.css" rel="stylesheet" type="text/css">
		<script language="javascript1.2">
function js_callpage(htmlurl)
{
	var newwin=window.open(htmlurl,'','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,top=2,width=360,height=470');
	return false;
}
function js_callpage1(htmlurl)
{
	var newwin=window.open(htmlurl,'','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,top=2,width=100,height=100');
	return false;
}
</script>




	</head>
	<body>
		<table align="center" border="0" cellpadding="0" cellspacing="0"
			width="980">
			<tbody>


				<tr>
					<td bgcolor="#dadce8" height="1">
						<img src="images/line.gif" height="1" width="1">
					</td>
				</tr>

				<tr>
					<td>
						<table border="1" cellpadding="0" cellspacing="0" width="100%">
							<tbody>
								<tr>
									<td bgcolor="#e5e5f0" valign="top" width="190">
										<table border="0" cellpadding="0" cellspacing="0" width="100%">
											<tbody>
												<tr>
													
												</tr>
												<tr>
													<td>
														<img src="images/gg11.jpg" height="60" width="180">
													</td>
												</tr>
												<tr><td height="400"></td>&nbsp;</tr>
												<tr>
												<td align="center">
												 <a href="ShowYzProductsSelf.jsp">	<font style="font-weight:bold;color:blue;TEXT-DECORATION: underline; ">译者订单自查询</font></a>
												 </td>
												 </tr>
												 
												 <tr>
												<td align="center">
												 <a href="ShowYzProductsSelf.jsp">	<font style="font-weight:bold;color:blue;TEXT-DECORATION: underline; ">译者意见采集</font></a>
												 </td>
												 </tr>


										</table>
									</td>
									<td width="10">
									</td>
									<td valign="top" width="780">
										<table style="border-collapse: collapse;" border="0"
											bordercolor="#111111" cellpadding="0" cellspacing="0"
											 width="100%">
											<tbody>
												<tr>
													<td valign="top" height="119">
														<table style="border-collapse: collapse;" border="0"
															bordercolor="#111111" cellpadding="0" cellspacing="0"
															width="100%">
															<tbody>
																<tr>
																	<td width="100%">
																		<input name="nowpcd" value="" type="hidden">
																		<table border="0" cellpadding="0" cellspacing="0"
																			width="100%">

																			<tbody>
																				<tr>
																					<td bgcolor="#e5e5f0" height="25">
																						<table style="border-collapse: collapse;"
																							border="0" cellpadding="0" cellspacing="0"
																							width="100%">
																							<tbody>
																								<br>
																								<tr>
																									<td>
																									</td>
																									<td align="right">
																										<font  size="2" color="blue">&nbsp;&nbsp;&nbsp;&nbsp; 
																										  <%=consumerid%>, 欢迎您！ 您目前的级别: 中级 &nbsp;&nbsp;&nbsp;&nbsp;  </font>
																										<a
																											href=""
																											class="mingcheng1"> <img src="/images/refresh.gif"></img> </a>
																											&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
																										<a href="UserLogin.jsp"><font style="font-weight:bold;color:blue;TEXT-DECORATION: underline; ">退出</font></a>
																										&nbsp;&nbsp;&nbsp;&nbsp; 	
																									</td>
																									
																								</tr>
																								<tr>
																									<td>
																										&nbsp;
																										<img src="images/m_33.gif" height="10"
																											width="10">
																										&nbsp;
																										<strong><a
																											href="">待翻译订单列表</a>
																										</strong> &nbsp;
																									</td>

																									<form method="post"
																										action="index_catalog.php?pma_code=21&amp;cat_code=107&amp;sub_cat_code=&amp;mfname_sel=&amp;sortby=pdate&amp;onepcd=&amp;nowpcd="></form>
																									<td align="right">
																										全部
																										<b><%=totalRecords%> </b>篇订单,共
																										<b><%=totalPages%> </b>页,当前第
																										<b><%=pageNo%> </b>页&nbsp;&nbsp;
																										<select size="1" name="pagenum" class="input"
																											onChange="submit()">
																											<option value="1" selected="selected">
																												第1页
																											</option>
																										</select>
																									</td>
																								</tr>


																							</tbody>
																						</table>
																					</td>

																				</tr>

																				<%
																						for (int i = 0; i < products.size(); i++) {
																						Product p = products.get(i);
																				%>

																				<tr>
																					<td align="center" height="100">
																						<table style="border-collapse: collapse;"
																							bgcolor="#ffffff" border="1" cellpadding="0"
																							cellspacing="0" width="95%">
																							<tbody>
																								<tr>
																									<td rowspan="2" width="108">
																										<a
																											href="ShowProductDetail.jsp?id=<%=p.getId()%>"
																											class="mingcheng1"> 订单编号：<%=p.getId()%></a>
																									</td>
																									<td rowspan="2" width="108">
																										 类型：<%=p.getArticle()%>
																									</td>																									
																									<td width="492">
																										<a href="ShowProductDetail.jsp?id=<%=p.getId()%>" class="mingcheng1">&nbsp; 订单标题：<%=p.getSubject()%></a>&nbsp;
																									</td>
																									
																									<td rowspan="2" width="108">

																										
																										&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
																										<a
																											href="ShowYzProductsSelf.jsp?orderId=<%=p.getId()%>"
																											class="mingcheng1"> <img src="/images/qiangD.gif"></img> </a>
																									</td>
																								</tr>

																								<tr>
																									<td width="492">
																										&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
																										字数：
																										<font color="#0000ff">共   <%=p.getContent().length()%> 字</font>
																										&nbsp;&nbsp;&nbsp;价格：<font  size="3" color="red">￥<%=(int)(p.getContent().length()*0.42)%></font>
																										&nbsp;&nbsp;发布时间：
																										<font color="#0000ff"><%=p.getSave_time()%></font>																										
																										&nbsp;&nbsp;<br>
																										&nbsp;&nbsp;&nbsp;&nbsp; 难度：<font  size="2" color="red">中</font>；    紧迫度：<font  size="2" color="red">急</font>；
																										<a
																											href="ShowProductDetail.jsp?id=<%=p.getId()%>"
																											> <font color="#0000ff"><u>详细</u></font> </a>																										
																									</td>
																								</tr>
																							</tbody>
																						</table>
																					</td>
																				</tr>
																				<tr>
																					<td align="center" height="20" valign="middle">
																						<img src="images/3j_line_2.gif" height="3"
																							width="744">
																					</td>
																				</tr>

																				<%
																				} // end for
																				%>

																			</tbody>
																		</table>
																	</td>
																</tr>

															</tbody>
														</table>
													</td>
												</tr>
											</tbody>
										</table>
									</td>
								</tr>
							</tbody>
						</table>
					</td>
				</tr>
				<tr>
					<td width="100%">
						<!--底部INC--><br>
					</td>
				</tr>
			</tbody>
		</table>
	</body>
</html>
